﻿using Microsoft.EntityFrameworkCore;
using Reporting.Domain;
using Reporting.Domain.ForeignKey;
using Reporting.Domain.RBAC;

namespace Reporting.Infrastructure
{
    /// <summary>
    /// 上下文
    /// </summary>
    public class ReportingDbContext : DbContext
    {
        public ReportingDbContext(DbContextOptions options) : base(options)
        {
        }
        //--------------------------------------------------------------外健
        // 来源类型
        public DbSet<Sourcetype> Sourcetype { get; set; }
        // 产品类型
        public DbSet<ProductType> ProductType { get; set; }
        // 开、收票方
        public DbSet<Payee> Payee { get; set; }
        // 发票类型
        public DbSet<Invoicetype> Invoicetype { get; set; }




        //----------------------------生产管理
        //生产计划
        public DbSet<ProductionPlan> ProductionPlan { get; set; }
        //生产工单
        public DbSet<Productionorder> Productionorder { get; set; }


        //----------------------------开票发票
        //开票管理
        public DbSet<InvoiceManagement> InvoiceManagement { get; set; }

        //到票管理
        public DbSet<Ticketmanagement> Ticketmanagement { get; set; }

        //销售订单
        public DbSet<SaleOrder> SaleOrder { get; set; }


        //------------------------------RBAC
        // 用户
        public DbSet<User> User { get; set; }
        // 角色
        public DbSet<Role> Role { get; set; }
        // 权限
        public DbSet<Permission> Permission { get; set; }
        // 用户角色关联表
        public DbSet<UserRole> UserRole { get; set; }
        // 角色权限关系表
        public DbSet<RolePermissions> RolePermissions { get; set; }

    }
}
